<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>删除一个大型对象</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-lo-tell.html">pg_lo_tell</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-write.html">pg_lo_write</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.pg-lo-unlink" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_lo_unlink</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">pg_lo_unlink</span> &mdash; <span class="dc-title">删除一个大型对象</span></p>

   </div>
 
 <div class="refsect1 description" id="refsect1-function.pg-lo-unlink-description">
  <h3 class="title">说明</h3>
     <div class="methodsynopsis dc-description">
      <span class="type">bool</span> <span class="methodname"><strong>pg_lo_unlink</strong></span>
       ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>
      , <span class="methodparam"><span class="type">int</span> <code class="parameter">$oid</code></span>
      )</div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_lo_unlink()</strong></span> 删除由 <em><code class="parameter">oid</code></em> 指定的大型对象。成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
    </p>
    <p class="para">
     要使用大型对象（lo）接口，需要将其放置在事务块中。
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      本函数以前的名字为 <em>pg_lo_unlink()</em>。
     </p>
    </p></blockquote>
   </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-lo-unlink-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">connection</code></em></dt>

     <dd>

      <p class="para">
       PostgreSQL database connection resource.  When 
       <em><code class="parameter">connection</code></em> is not present, the default connection 
       is used. The default connection is the last connection made by 
       <span class="function"><a href="function.pg-connect.html" class="function">pg_connect()</a></span> or <span class="function"><a href="function.pg-pconnect.html" class="function">pg_pconnect()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">oid</code></em></dt>

     <dd>

      <p class="para">
       The <var class="varname"><var class="varname">OID</var></var> of the large object in the database.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-unlink-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.pg-lo-unlink-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2046">
    <p><strong>Example #1 <span class="function"><strong>pg_lo_unlink()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;OID&nbsp;of&nbsp;the&nbsp;large&nbsp;object&nbsp;to&nbsp;delete<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$doc_oid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">189762345</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$database&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=jacarta"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"begin"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_lo_unlink</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$doc_oid</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"commit"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div> 
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.pg-lo-unlink-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.pg-lo-create.html" class="function" rel="rdfs-seeAlso">pg_lo_create()</a> - 新建一个大型对象</span></li>
    <li class="member"><span class="function"><a href="function.pg-lo-import.html" class="function" rel="rdfs-seeAlso">pg_lo_import()</a> - 将文件导入为大型对象</span></li>
   </ul>
  </p>
 </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-lo-tell.html">pg_lo_tell</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-write.html">pg_lo_write</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
